#include <REGX51.H>
#include <intrins.h>
#define uchar unsigned char
#define uint unsigned int
uchar tab[]={0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F,0x40};
sbit D0=P3^0;
sbit D1=P3^1;	
void delay(int i){
  unsigned char t;
	while(i--){
	for(t=120;t<125;t++);
	}
}
void led()
{
	int i,j;
	P0=0x01;
	for(i=0;i<7;i++)
	{
		P0=_crol_(P0,1);
		delay(5000);
	}
	P0=0x80;
	for(j=0;j<7;j++)
	{
		P0=_cror_(P0,1);
		delay(5000);
	}
}
void main()
{
	IT0=1;
	EX0=1;
	PX0=0;
	
	IT1=0;
	EX1=1;
	PX1=1;
	
	EA=1;
	while(1)
	{
		led();
//		P3_6=IE0;
//	  P3_7=IE1;
	}

}
void INT_0() interrupt 0 
{
	int i=0;
	unsigned char num[]={0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F,0x40};
		for(i=0;i<11;i++)
	{
		P1=num[i];
		delay(10000);
	}
}
void INT_1() interrupt 2  
{
	int i=0;
	unsigned char num[]={0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F,0x40};
		for(i=0;i<11;i++)
	{
		P2=num[i];
		delay(10000);
	}
}